import { NgModule } from "@angular/core";
import { StoreModule } from "@ngrx/store";
import * as themeStore from "./reducers/theme.reducer";
import * as keywordStore from "./reducers/keyword.reducer";

export enum Selectors {
  theme = "theme",
  keyword = "keyword"
}

export interface AppState {
  [Selectors.theme]: themeStore.State;
  [Selectors.keyword]: keywordStore.State;
}

export const AppReducer = {
  [Selectors.theme]: themeStore.reducer,
  [Selectors.keyword]: keywordStore.reducer
};

@NgModule({
  imports: [StoreModule.forRoot({ ...AppReducer })]
})
export class AppStoreModule {}
